const Constant = {
  LogisticsStatus: [
    { value: 0, label: 'foo', type: 'info', desc: '' }
  ],
  GenderCode: [
	{ value: 0, label: '女', type: 'warning' },
	{ value: 1, label: '男', type: 'primary' },
	{ value: 2, label: '不公开', type: 'info' }
  ],
  Communicate: [
	  { value: "0", label: '是', type: 'success' },
	  { value: "1", label: '否', type: 'warning' },
  ],
  Assign: [
	  { value: "1", label: '是', type: 'success' },
	  { value: "0", label: '否', type: 'warning' },
  ],
  ReportType: [
	  { value: "1", label: '内幕交易', type: 'primary' },
	  { value: "2", label: '利用未公开信息交易', type: 'success' },
	  { value: "3", label: '操纵市场', type: 'primary' },
	  { value: "4", label: '持续信息披露违法违规', type: 'warning' },
	  { value: "5", label: '发行信息披露违法违规', type: 'error' },
	  { value: "6", label: '其他违法违规行为', type: 'info' }
  ],
  TypeCde: [
	  { value: "1", label: '股票', type: 'primary' },
	  { value: "2", label: '债券', type: 'success' },
	  { value: "3", label: '基金', type: 'primary' },
	  { value: "4", label: '期货合约', type: 'warning' }
  ],
  CompanyType: [
	  { value: "1", label: '上市公司', type: 'primary' },
	  { value: "2", label: '挂牌公司', type: 'success' },
	  { value: "3", label: '债券发行人', type: 'warning' }
  ],
  BusinessCode: [
  	  { value: "Q", label: '咨询', type: 'primary' },
  	  { value: "S", label: '建议', type: 'success' },
	  { value: "C", label: '投诉', type: 'success' },
  	  { value: "R", label: '举报', type: 'warning' }
  ],
  DiscVlarTypeCde: [
	  { value: "1", label: '未披露', type: 'primary' },
	  { value: "2", label: '未及时披露', type: 'success' },
	  { value: "3", label: '披露信息存在虚假记载、误导性陈述或重大遗漏', type: 'warning' },
	  { value: "4", label: '持股变动信息披露违规', type: 'error' },
  ],
  ContentType: {
	  formUrlencoded : "application/x-www-form-urlencoded",
	  formData : "multipart/form-data",
	  applicationJson :"application/json",
	  textXml: "text/xml" 
  }
}



export const findConstant = (props, val) => {
  let list = getConstant(props);
  const item = list.find(item => item.value == val)
  return item || { value: val, label: '未知', type: 'info' }
}

export const getConstant = (value) => {
    if (Constant.hasOwnProperty(value)) {
      return Constant['' + value + '']
    } else {
      return []
    }
}

export default Constant
